import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:todo_project/data/task_data.dart';

class TaskItem extends StatelessWidget {
  TaskData taskData;

  TaskItem({Key? key, required this.taskData}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: 12.w).copyWith(bottom: 12.w),
      child: Card(
        child: buildItemInner(),
        elevation: 4.w,
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
      ),
    );
  }

  Padding buildItemInner() {
    return Padding(
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Expanded(child: Text(taskData.title)),
            SizedBox(
              width: 10.w,
            ),
            Checkbox(value: false, onChanged: (check) {})
          ],
        ),
        padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.w));
  }
}
